package zxs.sino.elite.hub.enums.user;

import zxs.sino.elite.hub.enums.BaseEnum;

/**
 * 用户状态
 *
 * @author zhang
 */
public enum UserStatus implements BaseEnum<Integer> {

    OFF(0, "禁用"),
    ON(1, "可用");


    private final int code;
    private final String value;

    UserStatus(int code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static boolean isOff(Integer code) {
        return BaseEnum.isType(UserStatus.class, code, OFF);
    }

    public static boolean isOn(Integer code) {
        return BaseEnum.isType(UserStatus.class, code, ON);
    }
}